
public class lx {

	
	
	public static int count=0;
	public static void main(String[] argc){
		
		
		
		move(3, 'a','b', 'c');
		
		echo("count:"+count+"\n"); //2^n-1 n= 1,2,3,4....n
		
		
	}
	
	public static void move(int n , char a,char b,char c){
		count++;
		
		if( n == 1){
			
			echo("move "+n+" from "+a+" to "+c+"\n");
			
			return ;
		}
		
		move(n-1, a, c, b);
		echo("move "+n+" from "+a+" to "+c+"\n");
		move(n-1, b, a, c);
		
	}
	
	
	public static void echo(int  msg){
		
		
		System.out.print(msg);
	}
	public static void echo(String msg){
		
		
		System.out.print(msg);
	}

	

}
